find a peak element in array